home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / Inspectors / InspectMe / PSWraps.psw < prev    next >
Text File  |  1995-06-12  |  2KB  |  93 lines

  1. defineps PSthing1( int num,size; float width,height; boolean squares)
  2.  
  3. usertime srand
  4.  
  5. /getx {rand 1000 mod 1000 div width mul} bind def
  6. /gety {rand 1000 mod 1000 div height mul} bind def
  7. /getradius {rand 1000 mod 1000 div size mul} bind def
  8. /setcolor {rand 1000 mod 1000 div 1 1 sethsbcolor} bind def
  9.  
  10. /drawcircle {getx gety size 0 360 arc fill flushgraphics} bind def
  11. /drawsquare {getx gety moveto 
  12.             size 0 rlineto 
  13.             0 size rlineto 
  14.             size neg 0 rlineto
  15.             closepath
  16.             fill } bind def
  17. num{setcolor squares {drawsquare} {drawcircle} ifelse }repeat
  18.  
  19. endps
  20.  
  21. defineps PStank( float w,h; boolean highlighted)
  22.   w h scale
  23. 0 setlinewidth
  24.  
  25. % left leg
  26.     0.05 0.01 moveto 0.1 0.01 lineto 0.1 0.4 lineto 0.05 0.4 lineto closepath
  27.     gsave
  28.     .666 setgray  fill
  29.     grestore 0 setgray stroke
  30.  
  31. % left loadcell
  32.     0.02 0.01 moveto 0.13 0.01 lineto 0.13 0.05 lineto 0.02 0.05 lineto closepath
  33.     gsave
  34.     .666 setgray  fill
  35.     grestore 0 setgray stroke
  36.  
  37. % right leg
  38.     0.9 0.01 moveto 0.95 0.01 lineto 0.95 0.4 lineto 0.9 0.4 lineto closepath
  39.     gsave
  40.     .666 setgray  fill
  41.     grestore 0 setgray stroke
  42.  
  43. % right loadcell
  44.     0.87 0.01 moveto 0.98 0.01 lineto 0.98 0.05 lineto 0.87 0.05 lineto closepath
  45.     gsave
  46.     .666 setgray  fill
  47.     grestore 0 setgray stroke
  48.  
  49. % "X-box" on top
  50.     0.4 0.92 moveto 0.6 0.92 lineto 0.6 0.99 lineto 0.4 0.99 lineto closepath
  51.     gsave
  52.     1 setgray  fill
  53.     grestore 
  54.     0.4 0.93 moveto 0.6 0.99 lineto
  55.     0.6 0.93 moveto 0.4 0.99 lineto
  56.     0 setgray stroke
  57.  
  58. % top right box
  59.     0.6 0.93 moveto 0.75 0.93 lineto 0.75 0.98 lineto 0.6 0.98 lineto closepath
  60.     gsave
  61.     0.333 setgray  fill
  62.     grestore    0 setgray stroke
  63.  
  64. % frame on top
  65.     0.22 0.75 moveto 0.35 0.92 lineto 0.65 0.92 lineto 0.77 0.77 lineto 
  66.     0.75 0.75 lineto 0.64 0.9 lineto 0.36 0.9 lineto 0.24 0.75 lineto
  67.     closepath
  68.     0.48 0.75 moveto 0.51 0.75 lineto 0.51 0.9 lineto  0.48 0.9 lineto
  69.     gsave
  70.     .333 setgray  fill
  71.     grestore 0 setgray stroke
  72.  
  73. % main box  
  74.     0 .35 moveto .5 .15 lineto .99 .35 lineto 0.99 0.65 lineto 0 0.65 lineto closepath
  75.     gsave
  76.     .666 setgray
  77.     highlighted {1 setgray} if fill
  78.     grestore 0 setgray stroke
  79.  
  80. % round top of box
  81.     gsave
  82.     0 .65 translate
  83.     1 .3 scale  
  84.     0.5 0 0.5 0 180 arc closepath
  85.     gsave
  86.     .666 setgray
  87.      highlighted {1 setgray} if fill
  88.     grestore 0 setgray stroke
  89.     grestore
  90.  
  91. endps
  92.  
  93.